import VueRouter from 'vue-router'
// 导入对应的路由组件
import Home from './components/tabbar/HomeContainer.vue'
import Member from './components/tabbar/MemberContainer.vue'
import Cart from './components/tabbar/CartContainer.vue'
import Search from './components/tabbar/SearchContainer.vue'
import NewsList from './components/news/NewsList.vue'
import NewsInfo from './components/news/NewsInfo.vue'

// 3. 创建路由对象
var router = new VueRouter({
    routes: [//配置路由规则的
        { path: '/', redirect: '/home'},
        { path: '/home', component: Home },
        { path: '/member', component: Member },
        { path: '/cart', component: Cart },
        { path: '/search', component: Search },
        { path: '/home/newslist', component: NewsList },
        { path: '/home/newsinfo/:id', component: NewsInfo }
    ],
    linkActiveClass: 'mui-active'   //覆盖默认的路由高亮的类，默认的是 router-link-active
})
// 暴露
export default router